package com.changgou.goods.dao;

import com.changgou.goods.pojo.Brand;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;

@Repository
public interface BrandMapper extends Mapper<Brand> {
    //自定义查询
    //根据分类名称查询品牌列表
    @Select("SELECT b.* FROM tb_brand b,tb_category c,tb_category_brand cb where b.id=cb.brand_id and c.id=cb.category_id and c.name=#{name}")
    public List<Brand> findListByCategoryName(@Param("name") String categoryName);

}
